package com.eastedu.repository.basic.po;

import com.eastedu.utils.PrimaryKeyGenerator;
import jakarta.persistence.Id;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

/**
 * 〈〉
 *
 * @author ZHISHUAI.ZHANG
 * @since 2021 /8/2
 */
@Slf4j
@Data
public class BasicResourceFileDTO {
    @Id
    private Long id;
    private String basicResourceId;
    private String fileId;
    private Long size;
    private String md5;
    private String fileName;
    private String extension;
    private Long createTime;
    private Long updateTime;
    private String downloadUrl;
    private String previewUrl;
    private Long duration;
    private Boolean encryption;


    /**
     * Copy basic resource file po.
     *
     * @param basicResourceId the basic resource id
     * @return the basic resource file po
     */
    public BasicResourceFilePO copy(String basicResourceId) {
        BasicResourceFilePO po = new BasicResourceFilePO();
        po.setId(PrimaryKeyGenerator.generateKey());
        po.setBasicResourceId(basicResourceId);
        po.setFileId(this.fileId);
        po.setSize(this.size);
        po.setMd5(this.md5);
        po.setFileName(this.fileName);
        po.setExtension(this.extension);
        po.setCreateTime(this.createTime);
        po.setUpdateTime(this.updateTime);
        po.setDownloadUrl(this.downloadUrl);
        po.setPreviewUrl(this.previewUrl);
        po.setDuration(this.duration);
        po.setEncryption(this.encryption);
        return po;
    }

}